<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>带超时机制的信号等待</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pcntl-sigprocmask.html">pcntl_sigprocmask</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pcntl-sigwaitinfo.html">pcntl_sigwaitinfo</a></div>
 <div class="up"><a href="ref.pcntl.html">PCNTL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.pcntl-sigtimedwait" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pcntl_sigtimedwait</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0)</p><p class="refpurpose"><span class="refname">pcntl_sigtimedwait</span> &mdash; <span class="dc-title">带超时机制的信号等待</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.pcntl-sigtimedwait-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>pcntl_sigtimedwait</strong></span>
    ( <span class="methodparam"><span class="type">array</span> <code class="parameter">$set</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$siginfo</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$seconds</code><span class="initializer"> = 0</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$nanoseconds</code><span class="initializer"> = 0</span></span>
  ]]] )</div>

  <p class="para rdfs-comment">
   函数<span class="function"><strong>pcntl_sigtimedwait()</strong></span>实际上与<span class="function"><a href="function.pcntl-sigwaitinfo.html" class="function">pcntl_sigwaitinfo()</a></span>
   的行为一致，不同在于它多了两个增强参数<em><code class="parameter">seconds</code></em>和
   <em><code class="parameter">nanoseconds</code></em>，这使得脚本等待的事件有了一个时间的上限。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pcntl-sigtimedwait-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">set</code></em></dt>

     <dd>

      <p class="para">
       要等待的信号列表数组。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">siginfo</code></em></dt>

     <dd>

      <p class="para">
       <em><code class="parameter">siginfo</code></em>是一个输出参数，用来返回信号的信息。更详细情况参见
       <span class="function"><a href="function.pcntl-sigwaitinfo.html" class="function">pcntl_sigwaitinfo()</a></span>。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">seconds</code></em></dt>

     <dd>

      <p class="para">
       超时秒数。
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">nanoseconds</code></em></dt>

     <dd>

      <p class="para">
       超时纳秒数。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pcntl-sigtimedwait-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时，函数<span class="function"><strong>pcntl_sigtimedwait()</strong></span>返回信号编号。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pcntl-sigtimedwait-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.pcntl-sigprocmask.html" class="function" rel="rdfs-seeAlso">pcntl_sigprocmask()</a> - 设置或检索阻塞信号</span></li>
    <li class="member"><span class="function"><a href="function.pcntl-sigwaitinfo.html" class="function" rel="rdfs-seeAlso">pcntl_sigwaitinfo()</a> - 等待信号</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.pcntl-sigprocmask.html">pcntl_sigprocmask</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.pcntl-sigwaitinfo.html">pcntl_sigwaitinfo</a></div>
 <div class="up"><a href="ref.pcntl.html">PCNTL 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
